<%@ page isELIgnored="false" language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib prefix="fmt" 
           uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js">
</script>
<style>
	.selectinput
	{
		width:350px;
	}
</style>
<title>Insert title here</title>
</head>
<body>
	<p>欢迎${sessionScope.name}</p>
	<a href="${pageContext.request.contextPath }/employee/register"><button>登记货物</button></a>
	<a href="${pageContext.request.contextPath }/employee/toEmployeeOrder"><button>查看订单</button></a>
	<a href="${pageContext.request.contextPath }/employee/toEmployeeMessage"><button>修改员工信息</button></a>
	<a href="${pageContext.request.contextPath }/user/logout"><button>登出</button></a>
	<br/>
	<form action="${pageContext.request.contextPath }/goods/selectbycol" method="post">
	查询条件：
		<table width="100%" border=1>
			<tr>
				<td><input type="submit" value="查询"/></td>
				<td><label>商品类型:</label><input class="selectinput"  type="text" name="type.typename" /></td>
				<td><label>商品状态:</label><input class="selectinput"  type="text" name="goods.status" /></td>
				<td><label>商品名字:</label><input class="selectinput"  type="text" name="goods.name"/></td>
			</tr>
		</table>
	</form>
	上架商品列表：
		<table width="100%" border=1 style="text-align:center">
			<tr>
				<td>商品名字</td>
				<td>商品类型</td>
				<td>商品价格</td>
				<td>生产日期</td>
				<td>有效期(限食品)</td>
				<td>生产商(限食物和衣服)</td>
				<td>出版社(限书本)</td>
				<td>尺码(限衣服)</td>
				<td>数量</td>
				<td>下架日期</td>
				<td>商品优惠信息</td>
				<td>商品状态</td>
				<td>操作</td>
			</tr>
		<c:if test="${enhanceList!=null}">
			<c:forEach items="${enhanceList}" var="enhance">
				<tr>
					<td>${enhance.goods.name}</td>
					<td>${enhance.type.typename}</td>
					<td>${enhance.goods.price}元</td>
					<td><fmt:formatDate value="${enhance.goods.prodate}" pattern="yyyy-MM-dd"/></td>
					<td><fmt:formatDate value="${enhance.goods.effdate}" pattern="yyyy-MM-dd"/></td>
					<td>${enhance.goods.producer}</td>
					<td>${enhance.goods.publisher}</td>
					<td>${enhance.goods.size}</td>
					<td>${enhance.goods.num}</td>
					<td>${enhance.goods.outdate}</td>
					<td>${enhance.discountsMessage.describe}</td>
					<td class="status">${enhance.goods.status}</td>
					<td>
						<a class="putaway" href="${pageContext.request.contextPath }/goods/toputaway?id=${enhance.goods.id}">上架</a>
					</td>
				</tr>
			</c:forEach>
		</c:if>
		</table>
	
	
	
		<c:if test="${jurisdiction}">
			<script>
				(function()
				{
					alert("您没有权限！")
				})();
			</script>
		</c:if>
		<script>
				$(document).ready(function(){
					$.each($(".status"),function(index,content){
						if($(content).text()=="已上架")
						{
							$(".putaway").eq(index).hide();
						}
					})
				})
		</script>
</body>
</html>